package cn.onein.edu.biz.bean;

import java.util.Date;

import cn.onein.edu.common.OrderFromType;
import cn.onein.edu.common.OrderStatusType;
import cn.onein.edu.common.PaymentType;

public class Order {

	private Long id;
	
	private String orderNo;
	
	private Long userId;
	
	private Integer amount;
	
	private PaymentType paymentType;
	
	private String paymentNo;
	
	private OrderFromType orderFrom;
	
	private OrderStatusType orderStatus;
	
	private Date orderDate;
	
	private Date updateDate;
	
	private String userPayAccount;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Integer getAmount() {
		return amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}

	public PaymentType getPaymentType() {
		return paymentType;
	}

	public void setPaymentType(PaymentType paymentType) {
		this.paymentType = paymentType;
	}

	public String getPaymentNo() {
		return paymentNo;
	}

	public void setPaymentNo(String paymentNo) {
		this.paymentNo = paymentNo;
	}

	public OrderFromType getOrderFrom() {
		return orderFrom;
	}

	public void setOrderFrom(OrderFromType orderFrom) {
		this.orderFrom = orderFrom;
	}

	public OrderStatusType getOrderStatus() {
		return orderStatus;
	}

	public void setOrderStatus(OrderStatusType orderStatus) {
		this.orderStatus = orderStatus;
	}

	public Date getOrderDate() {
		return orderDate;
	}

	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public String getUserPayAccount() {
		return userPayAccount;
	}

	public void setUserPayAccount(String userPayAccount) {
		this.userPayAccount = userPayAccount;
	}
	
	public void setPaymentTypeValue(Integer paymentTypeValue){
		if(paymentTypeValue == null){
			this.paymentType = null;
			return;
		}
		PaymentType[] type = PaymentType.values();
		this.paymentType = type[paymentTypeValue];
	}
	
	public Integer getPaymentTypeValue(){
		return this.paymentType.ordinal();
	}
	
	public void setOrderFromTypeValue(Integer orderFromTypeValue){
		if(orderFromTypeValue == null){
			this.orderFrom = null;
			return;
		}
		OrderFromType[] type = OrderFromType.values();
		this.orderFrom = type[orderFromTypeValue];
	}
	
	public Integer getOrderFromTypeValue(){
		return this.orderFrom.ordinal();
	}
	
	public void setOrderStatusTypeValue(Integer orderStatusTypeValue){
		if(orderStatusTypeValue == null){
			this.orderStatus = null;
			return;
		}
		OrderStatusType[] type = OrderStatusType.values();
		this.orderStatus = type[orderStatusTypeValue];
	}
	
	public Integer getOrderStatusTypeValue(){
		return this.orderStatus.ordinal();
	}
}
